<%--
  Created by IntelliJ IDEA.
  User: zyvictor
  Date: 2020/5/31
  Time: 9:11
  To change this template use File | Settings | File Templates.
--%>


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <c:set var="request" value="${pageContext.request.contextPath}"/>
    <title>layuiAdmin 文章管理 iframe 框</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${request}/static/plugins/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${request}/static/plugins/layuiadmin/style/admin.css" media="all">

</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
     style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">员工编号</label>
        <div class="layui-input-inline">
            <input type="text" name="id" id="id" autocomplete="off" hidden disabled value="${empScalesInfo.employeeId}" class="layui-input" lay-verify="name">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">员工姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="name" id="name" autocomplete="off" value="" class="layui-input" lay-verify="name">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">原始部门</label>
        <div class="layui-input-inline">
            <input type="text" name="oldDepartment" id="oldDepartment" readonly autocomplete="off" value="员工" class="layui-input" lay-verify="name">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">调入部门</label>
        <div class="layui-input-inline">
            <select name="newDepartment" id="newDepartment" lay-verify="required">

            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">原始职位</label>
        <div class="layui-input-inline">
            <input type="text" name="oldPosition" id="oldPosition" readonly autocomplete="off" value="员工" class="layui-input" lay-verify="name">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">调入职位</label>
        <div class="layui-input-inline">
            <select name="newPosition" id="newPosition" lay-verify="required">

            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">调动时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="modifyTime" name="modifyTime" lay-verify="submit_time">
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit"
               value="确认编辑">
    </div>
</div>

<script src="${request}/static/plugins/layuiadmin/layui/layui.js"></script>
<script src="${request}/static/custom/js/myLayVerify.js"></script>
<script src="${request}/static/custom/js/myValidity.js"></script>
<script>
    layui.config({
        base: '${request}/static/plugins/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','laydate'], function () {
        var $ = layui.$
            , form = layui.form
            , laydate = layui.laydate;


        laydate.render({
            elem: '#modifyTime' //指定元素
            ,value: '2020-5-1'
            ,isInitValue: false //是否允许填充初始值，默认为 true'
            ,min: '1920-1-1'
            ,max: '2099-12-31'
        });

        $.ajax({
            type:"get",
            url:"${request}/department/getDeptList.html",
            success:function (data) {
                console.log(data);
                for(var i = 0; i<data.extendInfo.depNameList.length; i++){
                    var json = data.extendInfo.depNameList[i];
                    var str ="";
                    str += '<option value="' + json + '">' + json + '</option>';
                    $("#newDepartment").append(str);
                }
                form.render('select');
            }
        });


        $.ajax({
            type:"get",
            url:"${request}/sysconfig/getJobTitle.html",
            success:function (data) {
                console.log(data);
                for(var i = 0; i<data.extendInfo.jobTitleList.length; i++){
                    var json = data.extendInfo.jobTitleList[i];
                    var str ="";
                    str += '<option value="' + json + '">' + json + '</option>';
                    $("#newPosition").append(str);
                }
                form.render('select');
            }
        });

    })
</script>
</body>
</html>
